import java.util.concurrent.Callable;

/**
 * @Author: Aerospace
 * @Date: 2023/11/21 9:27
 * @Description: Dream begins
 */
public class Collabledemo implements Callable<String> {
    private int n;

    public Collabledemo(int n) {
        this.n = n;
    }

    @Override
    public String call() throws Exception {
        int sum = 0;
        for (int i = 0; i < n; i++) {
            sum += i;
        }
        return Thread.currentThread().getName() + "执行结果:" + sum;
    }
}
